<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>{:__('Scout Chain')}</title>
		<link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" type="image/x-icon">
		<script type="text/javascript">
            //适配移动端
			function resize() {
				var deviceWidth = document.documentElement.clientWidth;
				if (deviceWidth < 240) deviceWidth = 240;
					document.documentElement.style.cssText = 'font-size:' + (deviceWidth / 15) + 'px!important';
			}
			window.addEventListener('resize', resize);
			resize();
        </script>
        <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
		<script src="__CDN__/assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
		<link rel="stylesheet" type="text/css" href="__CDN__/assets/libs/bootstrap/dist/css/bootstrap.min.css"/>
		<link rel="stylesheet" href="__CDN__/assets/css/scoute/indexMobile.css"/>
	</head>
	<body>
		<nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container-fluid">  
                <div class="navbar-header">
                       <a class="navbar-brand">
                       	   <img src="__CDN__/assets/img/scoute/web/home_logo.png"/>
                       </a>
                       <button class="navbar-toggle" data-toggle="collapse" data-target="#navbar"></button>
                </div>
                <div id="navbar" class="collapse navbar-collapse">
                    <ul class="nav navbar-nav navList">
                        <li><a href="{:url('Index/index')}#bps">{:__('About CTS')}</a></li>
                        <li><a href="{:url('Index/index')}#qtl">{:__('Sales plan')}</a></li>
                        <li><a href="#">{:__('White Book')}</a></li>
                        <li><a href="{:url('Blog/blog')}">{:__('Blog')}</a></li>
                    </ul>
                </div>
                <div class="cutLan">
					{if($config['language']=='zh-cn')}中文{/if}
					{if($config['language']=='en')}EN{/if}
	            	<img class="selectLan" src="__CDN__/assets/img/scoute/mobile/top_icon.png" alt="" />
	            </div>
            </div>
        </nav>
        <div class="lan">
			<div><a href="?ref=home/index&lang=en">EN</a></div>
			<div><a href="?ref=home/index&lang=zh-cn">中文</a></div>
	    </div>
	    <header class="header">
        	<img class="img-responsive" src="__CDN__/assets/img/scoute/mobile/mobile_banner_bg.png"/>
        	<div class="ad">
		        <h1>{:__('Harvest value')}</h1>
		        <p>{:__('Sports Festival')}</p>
		        <section id="bps">{:__('White Book')}</section>
		    </div>
        </header>
        <div class="introduce" id="introduce">
			<h2>{:__('What is')}</h2>
		    <p>{:__('Introduce1')}</p>
		    <p>{:__('Introduce2')}</p>
		    <p>{:__('Introduce3')}</p>
		</div>
		<div class="container-fluid user" id="user">
      		<h2>{:__('Value users')}</h2>
        	<p class="explain">{:__('National football')}</p>
        	<div class="userSec">
        		<div class="userSec1">
        			<h3>{:__('Teenager players')}</h3>
        			<p>{:__('A professional')}</p>
        			<p>{:__('To build')}</p>
        		</div>
        		<hr />
        		<div class="userSec2">
        			<h3>{:__('Fans rights')}</h3>
        			<p>{:__('Fans can1')}</p>
        			<p>{:__('Fans can2')}</p>
        			<p>{:__('Fans can3')}</p>
        		</div>
        	</div>
		</div>
		<div class="serve" id="serve">
			<h2>{:__('Product service')}</h2>
        	<p class="explain">{:__('On the basis')}</p>
        	<div  class="serveSec serve1">
        		<img src="__CDN__/assets/img/scoute/web/home/home_icon_prod01.png"/>
        		<h3>{:__('Open ticketing')}</h3>
        		<hr />
        		<p>{:__('The whole')}</p>
        	</div>
	        <div  class="serveSec serve2">
	        	<img src="__CDN__/assets/img/scoute/web/home/home_icon_prod02.png"/>
	        	<h3>{:__('Fair')}</h3>
	        	<hr />
	        	<p>{:__('The first')}</p>
	        </div>
	        <div  class="serveSec serve3">
	        	<img src="__CDN__/assets/img/scoute/web/home/home_icon_prod03.png"/>
	        	<h3>{:__('Point to')}</h3>
	        	<hr />
	        	<p>{:__('The platform')}</p>
	        </div>
        	<div  class="serveSec serve4">
	        	<img src="__CDN__/assets/img/scoute/web/home/home_icon_prod04.png"/>
	        	<h3>{:__('Sports')}</h3>
	        	<hr />
	        	<p>{:__('Decentralized')}</p>
	        </div>
	       	<div  class="serveSec serve5">
	        	<img src="__CDN__/assets/img/scoute/web/home/home_icon_prod05.png"/>
	        	<h3>{:__('Interactive')}</h3>
	        	<hr />
	        	<p>{:__('The media')}</p>
	        </div>
		</div>
		<div class="advantage" id="advantage">
			<img src="__CDN__/assets/img/scoute/mobile/mobile_adva_bg.png"/>
			<h2>{:__('Advantages')}</h2>
			<p class="explain">{:__('Based on')}</p>
			<div class="adv adv1">
				<h3>{:__('Open ticketing')}</h3>
        		<p>{:__('The whole')}</p>
				<div></div>
			</div>
			<div class="adv adv2">
				<h3>{:__('Fair')}</h3>
	        	<p>{:__('The first')}</p>
				<div></div>
			</div>
			<div class="adv adv3">
				<h3>{:__('Point to')}</h3>
	        	<p>{:__('The platform')}</p>
				<div></div>
			</div>
		</div>
		<div class="qtl" id="qtl">
			<div class="qtlSec">
				<div class="bz">
					<h2>{:__('Currency exchange')}</h2>
					<p class="explain">{:__('CTS digital')}<span style="display:block; height:0.4rem;"></span>1BTC=120000CTS；<br />1ETH=9000CTS；<br />1CAM=13CTS。</p>
					<div>
						<section class="ethBtn btn">ETH</section>
						<section class="btcBtn btn">BTC</section>
						<section class="camBtn btn">CAM</section>
					</div>
				</div>
			</div>
			<div class="dhxq eth">
				<div class="dhxqT"><span class="dhxqTit">{:__('Exchange')}</span><span class="dhxqClo"></span></div>
				<div class="dhbl"><span>{:__('Subscription')}：</span><span>1 ETH = {$list.eth_cts} CTS</span></div>
				<div class="dhNum">
					<div class="dhNum1">ETH{:__('Receivables')}：</div>
					<div class="dhNum2">
						<div class="copyText" id="copyText">{$list.eth_address}</div>
						<div class="copySec">
							<textarea id="input"></textarea>
							<img class="copy" src="__CDN__/assets/img/scoute/web/home/icon_copy.png" title="复制"/>
						</div>
					</div>
					
				</div>
				<form class="dhxqForm" action="" method="">
					<div class="formGroup formGroup1">
						<label class="lab1" for="">CTS{:__('Receivables')}：</label>
						<input type="text" name="" id="sk1" placeholder="{:__('Please input receivable')}" onfocus="this.placeholder=''" onblur="this.placeholder='{:__(\'Please input receivable\')}'" autocomplete="off"/>
						<!--<a class="yiwen" href=""><img src="../images/Web/home/icon_mark.png" alt="" /></a>-->
						<!--<div class="daan">如何获取CTS钱包</div>-->
						<p class="how"><a href="#">{:__('How to get')}</a></p>
					</div>
					<div class="formGroup formGroup2">
						<label class="lab2" for="">ETC{:__('Payment')}：</label>
						<input type="text" name="" id="fk1" placeholder="{:__('Please input payment')}" onfocus="this.placeholder=''" onblur="this.placeholder='{:__(\'Please input payment\')}'" autocomplete="off"/>
					</div>
					<div class="formGroup formGroup3">
						<label class="lab3" for="">ETH{:__('Number')}：</label>
						<input type="text" name="" id="cts1" placeholder="" autocomplete="off"/>
					</div>
					<section><span>CTS {:__('Number')}：</span><span class="ctsNum1"></span></section>
					<div class="btnList">
						<input class="cancel" type="button" value="{:__('Cancel')}" />
						<input class="submit" id="eth_submit" type="submit" value="{:__('Submit')}" />
					</div>
				</form>
				<div class="tishi">{:__('Copy success')}</div>
			</div>
			<div class="dhxq btc">
				<div class="dhxqT"><span class="dhxqTit">{:__('Exchange')}</span><span class="dhxqClo"></span></div>
				<div class="dhbl"><span>{:__('Subscription')}：</span><span>1 BTC = {$list.btc_cts} CTS</span></div>
				<div class="dhNum">
					<div class="dhNum1">BTC{:__('Receivables')}：</div>
					<div class="dhNum2">
						<div class="copyText" id="copyText">
							{$list.btc_address}
						</div>
						<div class="copySec">
							<textarea id="input"></textarea>
							<img class="copy" src="__CDN__/assets/img/scoute/web/home/icon_copy.png" title="{:__('Copy')}"/>
						</div>
					</div>
				</div>
				
				<form class="dhxqForm" action="" method="">
					<div class="formGroup formGroup1">
						<label class="lab1" for="">CTS{:__('Receivables')}：</label>
						<input type="text" name="" id="sk2" placeholder="{:__('Please input receivable')}" onfocus="this.placeholder=''" onblur="this.placeholder='{:__(\'Please input receivable\')}'" autocomplete="off"/>
						<!--<a class="yiwen" href=""><img src="__CDN__/assets/img/scoute/web/home/icon_mark.png" alt="" /></a>
						<div class="daan">{:__('How to get')}</div>-->
						<p class="how"><a href="#">{:__('How to get')}</a></p>
					</div>
					<div class="formGroup formGroup2">
						<label class="lab2" for="">BTC{:__('Payment')}：</label>
						<input type="text" name="" id="fk2" placeholder="{:__('Please input payment')}" onfocus="this.placeholder=''" onblur="this.placeholder='{:__(\'Please input payment\')}'" autocomplete="off"/>
					</div>
					<div class="formGroup formGroup3">
						<label class="lab3" for="">BTC{:__('Number')}：</label>
						<input type="text" name="" id="cts2" placeholder="" autocomplete="off"/>
					</div>
					<section><span>CTS {:__('Number')}：</span><span class="ctsNum2"></span></section>
					<div class="btnList">
						<input class="cancel" type="button" value="{:__('Cancel')}" />
						<input class="submit" id="btc_submit" type="submit" value="{:__('Submit')}" />
					</div>
				</form>
				<div class="tishi">{:__('Copy success')}</div>
			</div>
			<div class="dhxq cam">
				<div class="dhxqT"><span class="dhxqTit">{:__('Exchange')}</span><span class="dhxqClo"></span></div>
				<div class="dhbl"><span>{:__('Subscription')}：</span><span>1 CAM = {$list.cam_cts} CTS</span></div>
				<div class="dhNum">
					<div class="dhNum1">CAM{:__('Receivables')}：</div>
					<div class="dhNum2">
						<div class="copyText" id="copyText">
							{$list.cam_address}
						</div>
						<div class="copySec">
							<textarea id="input"></textarea>
							<img class="copy" src="__CDN__/assets/img/scoute/web/home/icon_copy.png" title="{:__('Copy')}"/>
						</div>
					</div>
				</div>
				
				<form class="dhxqForm" action="" method="">
					<div class="formGroup formGroup1">
						<label class="lab1" for="">CTS{:__('Receivables')}：</label>
						<input type="text" name="" id="sk3" placeholder="{:__('Please input receivable')}" onfocus="this.placeholder=''" onblur="this.placeholder='{:__(\'Please input receivable\')}'" autocomplete="off"/>
						<!--<a class="yiwen" href=""><img src="__CDN__/assets/img/scoute/web/home/icon_mark.png" alt="" /></a>
						<div class="daan">{:__('How to get')}</div>-->
						<p class="how"><a href="#">{:__('How to get')}</a></p>
					</div>
					<div class="formGroup formGroup2">
						<label class="lab2" for="">CAM{:__('Payment')}：</label>
						<input type="text" name="" id="fk3" placeholder="{:__('Please input payment')}" onfocus="this.placeholder=''" onblur="this.placeholder='{:__(\'Please input payment\')}'" autocomplete="off"/>
					</div>
					<div class="formGroup formGroup3">
						<label class="lab3" for="">CAM{:__('Number')}：</label>
						<input type="text" name="" id="cts3" placeholder="" autocomplete="off"/>
					</div>
					<section><span>CTS {:__('Number')}：</span><span class="ctsNum3"></span></section>
					<div class="btnList">
						<input class="cancel" type="button" value="{:__('Cancel')}" />
						<input class="submit" id="cam_submit" type="submit" value="{:__('Submit')}" />
					</div>
				</form>
				<div class="tishi">{:__('Copy success')}</div>
			</div>
		</div>
		<div class="sell">
			<div class="sellPro">
				<h2>CTS{:__('Sales progress')}</h2>
				<div class="pro">
					<div class="percent">{$list.percentage}%</div>
					<div class="proNum"></div>
					<div class="proD"><div class="proDd"></div></div>
				</div>
				<div class="harvest">
					<section><span>{:__('Get')}ETH：</span><span>{$list.eth_num} eth</span></section>
					<section><span>{:__('Get')}BTC：</span><span>{$list.btc_num} eth</span></section>
					<section><span>{:__('Get')}CAM：</span><span>{$list.cam_num} eth</span></section>
				</div>
				<div class="search">{:__('Query')}</div>
				
				<div class="jycx">
					<div class="jycxT"><span class="jycxTxt">{:__('Transaction query')}</span><span class="jycxClo"></span></div>
					<div class="jycxH">CTS{:__('Transaction query')}</div>
					<form class="jycxForm" action="" method="">
						<input type="text" name="" id="cxInput" placeholder="{:__('Please input query')}" onfocus="this.placeholder=''" onblur="this.placeholder='{:__(\'Please input query\')}'" autocomplete="off"/>
						<div class="btnList">
							<input class="cancel" type="button" value="{:__('Cancel')}" />
							<input class="submit" type="submit" value="{:__('Submit')}" />
						</div>
					</form>
				</div>
			</div>
			<div class="sellSec2">
				<h2>{:__('Sales plan')}</h2>
				<div class="sellSec2_S1">
					<div class="ses ses2">
						<p class="sesp1">Start</p>
						<p class="sesp2">{$list.start_Md}</p>
						<p class="sesp3">{$list.start_Hi} (UTC)</p>
					</div>
					<div class="ses ses2">
						<p class="sesp1">End</p>
						<p class="sesp2">{$list.end_Md}</p>
						<p class="sesp3">{$list.end_Hi} (UFC)</p>
					</div>
					<div class="ses ses3">
						<p class="sesp1">Token Amount</p>
						<p class="sesp2">{$list.token_amount} million</p>
						<p class="sesp3">CTS</p>
					</div>
				</div>
				<div class="sellSec2_S2">
					{volist name="award" id="vo" key="k"}
					<div class="sec sec{$k}">
						<canvas style="" id="yuan{$k}"></canvas>
						<hr />
						<span class="secp1">{:date('Y m.d',$vo.starttime)}-{:date('m.d',$vo.endtime)}</span>
						<span class="secp2">BOUNS</span>
					</div>
					{/volist}
				</div>
			</div>
		</div>
		<div class="plan" id="plan">
			<h2>{:__('Blueprint')}</h2>
			<p>{:__('Footer msg')}</p>
		</div>
		<div class="footer">
			<div class="tx">
				<ul>
					<li><a href="https://twitter.com/FACchain"><img src="__CDN__/assets/img/scoute/web/icon_footer_01_twitter.png"/></a></li>
					<li><a href=" "><img src="__CDN__/assets/img/scoute/web/icon_footer_02_facebook.png"/></a></li>
					<li><a href="https://0.plus/sp/FACchain"><img src="__CDN__/assets/img/scoute/web/icon_footer_03_telegram.png"/></a></li>
					<li><a href=" "><img src="__CDN__/assets/img/scoute/web/icon_footer_04_medium.png"/></a></li>
					<li><a href="https://github.com/facchain/"><img src="__CDN__/assets/img/scoute/web/icon_footer_05_github.png"/></a></li>
					<li><a href="https://weibo.com/u/6529215935"><img class="footerImg6" src="__CDN__/assets/img/scoute/web/icon_footer_06_microblog.png"/></a></li>
				</ul>
				<p>2018© ctschain.org</p>
			</div>
		</div>
	</body>
</html>
<script src="__CDN__/assets/libs/layer/dist/layer.js"></script>
<script type="text/javascript">
var isBegin1 = false;
var param = '{$val}';
var plan = '{$plan}';
var t = JSON.parse(param);//json对象序列化
var p = JSON.parse(plan);//json对象序列化

//查询
$('.query-submit').click(function () {
    var vParam = $('#cxInput').val();
    var openUrl = 'https://camchain.xyz/address/'+ vParam;
    window.open(openUrl);
});

//layer弹窗
function openAlert(msg) {
    layer.open({
        content: msg,
        style: 'background-color:#09C1FF; color:#fff; border:none;',
        shade: false
    });
}

$('.navbar button').click(function(){
	if(isBegin1 == false){
		$(this).css('width','0.6rem');
		$(this).css('height','0.6rem');
		$(this).css('background-color','#FFFFFF');
		$(this).css('background-image','url(__CDN__/assets/img/scoute/mobile/mobile_nav_icon02.png)');
	}else{
		$(this).css('width','0.76rem');
		$(this).css('height','0.6rem');
		$(this).css('background-image','url(__CDN__/assets/img/scoute/mobile/mobile_nav_icon01.png)');
	}
	isBegin1 = !isBegin1;
})
$('.nav').each(function(index,elem){
	$(this).click(function(e){
		if(isBegin1 == true){
			$('#navbar').removeClass('in');
			$('#navbar').attr('aria-expanded','fa;se');
			$(".navbar button").css('width','0.76rem');
			$(".navbar button").css('height','0.6rem');
			$(".navbar button").css('background-image','url(__CDN__/assets/img/scoute/mobile/mobile_nav_icon01.png)');
		}
		isBegin1 = !isBegin1;
	})
});
	
//中英文切换按钮
$('.cutLan').click(function(){
    //取消事件冒泡
    event.stopPropagation();
    $('.lan').slideToggle(250);
});
//点击空白处隐藏弹出层，下面为滑动消失效果和淡出消失效果。
$(document).click(function(event){
    var _con = $('.lan');  // 设置目标区域
    if(!_con.is(event.target) && _con.has(event.target).length === 0){ // Mark 1
    	//$('#divTop').slideUp('slow');  //滑动消失
        $('.lan').slideUp(250);   //淡出消失
    }
});
$('.lan>div').click(function(){
    //取消事件冒泡
    event.stopPropagation();
    $('.lan').slideUp(250);
});
	
//点击eth按钮弹出框
$('.ethBtn').click(function(){
	$('.eth').fadeIn(200);
	$('.jycx').fadeOut(200);
});
//点击btc按钮弹出框
$('.btcBtn').click(function(){
	$('.btc').fadeIn(200);
	$('.jycx').fadeOut(200);
});
//点击cam按钮弹出框
$('.camBtn').click(function(){
	$('.cam').fadeIn(200);
	$('.jycx').fadeOut(200);
});
//点击关闭按钮关闭弹窗
$('.dhxqClo').click(function(){
	$('.dhxq').fadeOut(200);
});
//点击取消按钮关闭弹窗
$('.dhxq .cancel').click(function(){
	$('.dhxq').fadeOut(200);
});

//点击查询按钮弹出框
$('.search').click(function(){
	$('.jycx').fadeIn(200);
	$('.dhxq').fadeOut(200);
});
//点击关闭按钮关闭弹窗
$('.jycxClo').click(function(){
	$('.jycx').fadeOut(200);
});
//点击取消按钮关闭弹窗
$('.jycx .cancel').click(function(){
	$('.jycx').fadeOut(200);
});
//ctsNum的值跟着eth输入框的值变化
$('#cts1').keyup(function(){
    var inputNum = $('#cts1').val();
    console.log(inputNum);
    var ethT = parseInt(t.eth_cts);
    var showNum1 = inputNum*ethT;
    $('.ctsNum1').text(showNum1);
});
//ctsNum的值跟着btc输入框的值变化
$('#cts2').keyup(function(){
    var inputNum = $('#cts2').val();
    var btcT = parseInt(t.btc_cts);
    var showNum2 = inputNum*btcT;
    $('.ctsNum2').text(showNum2);
});
//ctsNum的值跟着cts输入框的值变化
$('#cts3').keyup(function(){
    var inputNum = $('#cts3').val();
    var camT = parseInt(t.cam_cts);
    var showNum3 = inputNum*camT;
    $('.ctsNum3').text(showNum3);
});
//eth提交按钮点击事件
$('#eth_submit').click(function () {
    var url = "{:url('home/index/assetExchange')}";
    var typeAddress = $('#fk1').val();
    var ctsAddress = $('#sk1').val();
    var ethNum = $('#cts1').val();
    var ethT = parseInt(t.eth_cts);
    var ctsExchange = ethNum*ethT;
    var ethType = 1;
    $.ajax({
        type: 'POST',
        url: url,
        dataType: 'json',
        data: {
            type:ethType,
            type_address:typeAddress,
            cts_address:ctsAddress,
            type_num:ethNum,
            cts_exchange:ctsExchange,
        },
        success: function (res) {
            if ( res.code == 1 ) {
                $('.dhxq').fadeOut(200);
                openAlert(res.msg);
            }else {
                openAlert(res.msg);
            }
        }
    });
    return false;
});
//btc提交按钮点击事件
$('#btc_submit').click(function () {
    var url = "{:url('home/index/assetExchange')}";
    var typeAddress = $('#fk2').val();
    var ctsAddress = $('#sk2').val();
    var btcNum = $('#cts2').val();
    var btcT = parseInt(t.btc_cts);
    var ctsExchange = btcNum*btcT;
    var btcType = 2;
    $.ajax({
        type: 'POST',
        url: url,
        dataType: 'json',
        data: {
            type:btcType,
            type_address:typeAddress,
            cts_address:ctsAddress,
            type_num:btcNum,
            cts_exchange:ctsExchange,
        },
        success: function (res) {
            if ( res.code == 1 ) {
                $('.dhxq').fadeOut(200);
                openAlert(res.msg);
            }else {
                openAlert(res.msg);
            }
        }
    });
    return false;
});
//cam提交按钮点击事件
$('#cam_submit').click(function () {
    var url = "{:url('home/index/assetExchange')}";
    var typeAddress = $('#fk3').val();
    var ctsAddress = $('#sk3').val();
    var camNum = $('#cts3').val();
    var camT = parseInt(t.cam_cts);
    var ctsExchange = camNum*camT;
    var camType = 3;
    $.ajax({
        type: 'POST',
        url: url,
        dataType: 'json',
        data: {
            type:camType,
            type_address:typeAddress,
            cts_address:ctsAddress,
            type_num:camNum,
            cts_exchange:ctsExchange,
        },
        success: function (res) {
            if ( res.code == 1 ) {
                $('.dhxq').fadeOut(200);
                openAlert(res.msg);
            }else {
                openAlert(res.msg);
            }
        }
    });
    return false;
});
//复制
var copy = document.getElementsByClassName('copy')[0];
copy.addEventListener('click', function() {
	if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) { //区分iPhone设备  
		window.getSelection().removeAllRanges(); //这段代码必须放在前面否则无效  
		var Url2 = document.getElementById("copyText"); //要复制文字的节点  
		var range = document.createRange();
		// 选中需要复制的节点  
		range.selectNode(Url2);
		// 执行选中元素  
		window.getSelection().addRange(range);
		// 执行 copy 操作  
		var successful = document.execCommand('copy');
		// 移除选中的元素  
		window.getSelection().removeAllRanges();
		$(".tishi").show().delay(1500).fadeOut();
	} else {
		var Urltext = document.getElementById("copyText").innerText;
		var Url2 = document.getElementById("input"); //要复制文字的节点
		Url2.innerText = Urltext;
		Url2.select(); // 选择对象
		document.execCommand("Copy"); // 执行浏览器复制命令
		$(".tishi").show().delay(1500).fadeOut();
	}
});
$(".copy").hover(function(){
	$(".copy").attr('src','__CDN__/assets/img/scoute/web/home/icon_copy_01.png')
},function(){
	$(".copy").attr('src','__CDN__/assets/img/scoute/web/home/icon_copy.png')
});
$(".yiwen").hover(function(){
	$(".yiwen").attr('src','__CDN__/assets/img/scoute/web/home/icon_mark_01.png');
	$('.daan').show(250)
},function(){
	$(".yiwen").attr('src','__CDN__/assets/img/scoute/web/home/icon_mark.png');
	$('.daan').hide(100)
});

//绘制圆形进度条
var canvas1 = document.getElementById("yuan1");
var canvas2 = document.getElementById("yuan2");
var canvas3 = document.getElementById("yuan3");
var canvas4 = document.getElementById("yuan4");
var canvas5 = document.getElementById("yuan5");
circleProgress(p[0].rewards,100,canvas1);
circleProgress(p[1].rewards,100,canvas2);
circleProgress(p[2].rewards,100,canvas3);
circleProgress(p[3].rewards,100,canvas4);
circleProgress(p[4].rewards,100,canvas5);

function circleProgress(value, average,dom) {
	var canvas = dom;
	canvas.width = '88';
	canvas.height = '88';
	canvas.marginTop = '30';
	var context = canvas.getContext('2d');
	var _this = $(canvas),
		value = Number(value), // 当前百分比,数值
		average = Number(average), // 平均百分比
		color = "", // 进度条、文字样式
		maxpercent = 100, //最大百分比，可设置
		c_width = _this.width(), // canvas，宽度
		c_height = _this.height(); // canvas,高度
	// 判断设置当前显示颜色
	if(value == maxpercent) {
		color = "#ff8317";
	} else if(value > average) {
		color = "#27b5ff";
	} else {
		color = "#ff8317";
	}
	// 清空画布
	context.clearRect(0, 0, c_width, c_height);
	// 画初始圆
	context.beginPath();
	// 将起始点移到canvas中心
	context.moveTo(c_width / 2, c_height / 2);
	// 绘制一个中心点为（c_width/2, c_height/2），半径为c_height/2，起始点0，终止点为Math.PI * 2的 整圆
	context.arc(c_width / 2, c_height / 2, c_height / 2, 0, Math.PI * 2, false);
	context.closePath();
	context.fillStyle = '#ddd'; //填充颜色
	context.fill();
	// 绘制内圆
	context.beginPath();
	context.strokeStyle = color;
	context.lineCap = 'square';
	context.closePath();
	context.fill();
	context.lineWidth = 10.0; //绘制内圆的线宽度

	function draw(cur) {
		// 画内部空白
		context.beginPath();
		context.moveTo(24, 24);
		context.arc(c_width / 2, c_height / 2, c_height / 2 - 10, 0, Math.PI * 2, true);
		context.closePath();
		context.fillStyle = 'rgba(255,255,255,1)'; // 填充内部颜色
		context.fill();
		// 画内圆
		context.beginPath();
		// 绘制一个中心点为（c_width/2, c_height/2），半径为c_height/2-5不与外圆重叠，
		// 起始点-(Math.PI/2)，终止点为((Math.PI*2)*cur)-Math.PI/2的 整圆cur为每一次绘制的距离
		context.arc(c_width / 2, c_height / 2, c_height / 2 - 5, -(Math.PI / 2), ((Math.PI * 2) * cur) - Math.PI / 2, false);
		context.stroke();
		//在中间写字
		context.font = "bold 18pt Arial"; // 字体大小，样式
		context.fillStyle = color; // 颜色
		context.textAlign = 'center'; // 位置
		context.textBaseline = 'middle';
		context.moveTo(c_width / 2, c_height / 2); // 文字填充位置
		context.fillText(value + "%", c_width / 2, c_height / 2);
//		context.fillText("正确率", c_width / 2, c_height / 2 + 20);
	}
	// 调用定时器实现动态效果
	var timer = null,
		n = 0;

	function loadCanvas(nowT) {
		timer = setInterval(function() {
			if(n > nowT) {
				clearInterval(timer);
			} else {
				draw(n);
				n += 0.01;
			}
		}, 15);
	}
	loadCanvas(value / 100);
	timer = null;
};

//进度条
var changdu = t.percentage;
function jinDu(){
	var proW = $('.pro').outerWidth();
	var percentW = $('.percent').outerWidth() / 2;
	$('.proNum').css('width',changdu + "%");
	var  percent_left= "calc("+changdu+"% - 1.32rem)";
	$('.percent').css('left',percent_left);
	var  proD_left= "calc("+changdu+"% - 0.9rem)";
	$('.proD').css('left',proD_left);
}jinDu()
</script>
